/**
 * 检测用户角色
 * @type {string|[{trigger: string, message: string, required: boolean}]|*}
 */
import { useLocalStorage } from '@/hooks/useStorage'

const userTypeId = JSON.parse(useLocalStorage.getItem('userInfo'))?.userTypeId
/**
 * 检测是否是系统管理员
 */
export const isAdminUsers = () => !!(userTypeId && userTypeId === 101)
/**
 * 检测是否是企业用户
 */
export const isEnterpriseUsers = () => !!(userTypeId && userTypeId === 201)
/**
 * 检测是否是省级管理用户
 */
export const isProvincialUsers = () => !!(userTypeId && userTypeId === 301)
/**
 * 检测是否是地级管理用户
 */
export const isPrefectureUsers = () => !!(userTypeId && userTypeId === 401)
/**
 * 检测是否是县级管理用户
 */
export const isCountyUsers = () => !!(userTypeId && userTypeId === 501)
